{extend name="public/common"} {block name="body"}
<title>基本设置</title>
</head>
<style type="text/css">
.radius:hover{
 	color: #fff;
	border-color: #66b1ff;
	background-color: #66b1ff;
 }
 span:hover{
 	color: #333;
 }
 .btn-primary {
    color: #fff;
    background-color: #409eff;
    border-color: #409eff;
    height: 31px;
    border-radius: 5px;
    font-size: 14px;
    line-height: 24px !important;
}
</style>
<body>
  <nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>
   
    财务管理
    <span class="c-gray en">&gt;</span>
    代理返佣记录
    {if condition="$ticker eq 1"}
    <span class="c-gray en">&gt;</span>
    全部未返佣记录
    {/if}
    <a class="btn btn-success radius r"
      style="line-height: 1.6em; margin-top: 3px"
      href="javascript:location.replace(location.href);" title="刷新">
      <i class="Hui-iconfont">&#xe68f;</i>
    </a>
  </nav>
  <div style="padding:20px;height:30px;">
    
    <div class="new_box">
  <div class="cl pd-5 bg-1 bk-gray mt-20" style="height: 40px;background-color: #e5e5e5 !important; border-bottom: 1px solid #e4e7ed">


    <span class="l">
      <a class="btn" data-title="手动返佣记录表" href="{:url('recharge/agentList')}" style="background:#636363;border-color: #636363;color: #fff;margin-left: -1px;">手动返佣记录表</a>
      <span class="line">◆</span>
    </span>
    
    <span class="l">
      <a class="btn" data-title="返佣设置分组" href="{:url('recharge/agentSave')}" >返佣设置分组</a>
    </span>
  
  </div>
  </div>
<div class="text-c" style="padding :20px 0;">
					    <!-- <form action="" enctype="application/x-www-form-urlencoded" method="get" style="margin-left:20px;float:left;">
                          
              <input type="text" name="ss_sql" id="ss_sql" value="{$user}" placeholder="用户名" style="width:150px;border-radius: 5px;" class="input-text">
               <button class="btn btn-success" type="submit" style="margin-right:20px;border-radius: 5px;"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
                           </form> -->
					   <form action="" enctype="application/x-www-form-urlencoded" method="get" style="margin-left:20px;float:left;">
             <input type="text" name="ss_sql" id="ss_sql" value="{$user}" placeholder="用户名" style="width:150px;border-radius: 5px;" class="input-text">
					    时间从：
					    <input type="text" name="sDate1" value="{if($time[0])}{$time[0]|date="Y-m-d",###}{/if}" id="sDate1" onfocus="WdatePicker({maxDate:'%y-%M-%d'})"  class="input-text Wdate" style="width:120px;border-radius: 5px;">
					     到：
					    <input type="text" onfocus="WdatePicker({maxDate:'%y-%M-%d'})" name="sDate2" value="{if($time[1])}{$time[1]|date="Y-m-d",###}{/if}" id="sDate2"  class="input-text Wdate" style="width:120px;margin-right:15px;border-radius: 5px;">
					    <button class="btn btn-success" type="submit" style="margin-right:20px;border-radius: 5px;"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
					  </form>
					 
					  <!-- <form action="{:url('recharge/setopen')}" enctype="application/x-www-form-urlencoded" method="post" style="margin-left:20px;float:left;">
             
              <input type="radio" name="open" value="1" {if($open==1)}checked{/if}>自动
              <input type="radio" name="open" value="0" {if($open==0)}checked{/if}>手动
              <button class="btn btn-success" type="submit" style="margin-right:20px;border-radius: 5px;"><i class="Hui-iconfont">&#xe665;</i> 保存</button>
            </form> -->
					  <div style="float:left;margin-left:20px;">
            <form action="{:url('recharge/agentList')}" enctype="application/x-www-form-urlencoded" method="get" style="margin-left:20px;float:left;">
                <input type="hidden" name="ticker" value="1">
					      <button style="{if($ticker==1)}background:#e5e5e5;border-color: #e5e5e5;color: #333;{/if}" class="btn btn-primary radius"  href="/admin/recharge/agentList?ticker=1" >全部未返佣记录</button>
              </form> 
					      
					  </div>
	</div>
  
  <div class="page-container  dataTables_wrapper">
  
      <div id="tab-system" class="HuiTab">
      <form action="{:url('recharge/shenhe')}" method="post">
        <div class="tabCon">
          <div class="mt-20">
            <table
              class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
              <thead>
                <tr class="text-c">
                <th><input type="checkbox" id="dj"></th>
                <th>代理名称</th>
                <th>返佣金额</th>
                <th>统计时间</th>
                <th>返佣状态</th>
                </tr>
              </thead>
              <tbody>
              {volist name="query" id="item"}
                <tr class="text-c">
                  <td>{if($item.status==0)}<input type="checkbox" value="{$item.agent}" id="user" name="user[]">{/if}</td>
                	<td>{$item.agent}</td>
                	<td>{if($item.total>0)} <a style="text-decoration:underline;" href="javascript:;" onclick="parent.layer_show('{$item.agent}，{$item.in_time}佣金列表','/admin/statistics/commissionDetail?name={$item.agent}&in={$item.in_time}')">{$item.total}</a> {else/} 0 {/if}</td>
                	<td>{$item.in_time}</td>
                	{if($open==0)}
                	<td>{if($item.status==0 && $item.total>0)}未返<a href="{:url('recharge/fanyong')}?uid={$item.agent}" style="color:blue">（手动返佣）</a>{else/}<span>已返({if($item.fystatus==1)}手动{else/}自动{/if})</span>{/if}</td>
                	{else/}
                	<td>{if($item.status==0)}未返{else/}<span>已返</span>{/if}</td>
                	{/if}
                </tr>
                {/volist}
              </tbody>
            </table>
          </div>
        </div>
         <button class="btn btn-primary radius" >已选代理手动返佣</button>
         </form>
      </div>
      <div class="dataTables_paginate paging_simple_numbers" style="width:100%;">
          <div style="float:left;">  
                  每页显示<select name="limit" style="height:26px;" id="code">
                      <option value="20" {if condition="$limit eq 20"}selected{/if}>
                        20
                      </option>
                      <option value="50" {if condition="$limit eq 50"}selected{/if}>
                        50
                      </option>
                      <option value="100" {if condition="$limit eq 100"}selected{/if}>
                        100
                      </option>
                      
                      
                   </select>条
                  </div>
            <span style="float:right;margin-left:-2px;">总共{$query->lastPage()}页  当前第{$query->currentPage()}页 ，共{$query->total()}条</span>
            <div style="float:left;">{$query->render()}</div>
    </div>
  </div>
  </div>
{/block}

{block name="js"}
  <script type="text/javascript" src="__SYSMET__/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
  <script type="text/javascript">
    $(function() {
      $('.skin-minimal input').iCheck({
        checkboxClass : 'icheckbox-blue',
        radioClass : 'iradio-blue',
        increaseArea : '20%'
      });
      $("#tab-system").Huitab({
        index : 0
      });
    });
    $("#code").on('change',function(){
    var username=$("#ss_sql").val();
    var time1=$("#sDate1").val();
    var time2=$("#sDate2").val();
    var id = $(this).find('option:selected').val();
    var us=$("#usid").val();
    var ticker = '{$ticker}'
    window.location.href="/admin/recharge/agentList?ss_sql="+username+"&limit="+id+"&sDate1="+time1+"&sDate2="+time2+'&us='+us+'&ticker='+ticker;
  })
    $("#dj").click(function(){
    if($("#dj").is(":checked")){
      $(".text-c tr td #user").prop("checked",true);
    }else{
      $(".text-c tr td #user").prop("checked",false);
    }
  })
</script>

{/block}
